<!DOCTYPE html>
<html lang="zh-CN">
<head>
 
<#include "bases/global_style.ftl">
<#include "bases/global_js.ftl">
<#include "bases/combo.ftl">
 
	    
    <script>
        var curent_page=${currentpage};
 
   
        jQuery(document).ready(function()
        {
            var optInit = getOptionsFromForm();
            $("#Pagination").pagination(${totalRecord}, optInit);
            App.init();
        });
 
        function doTableSort(ID){
        	
            $("#postsortfield").val(ID);
            $("#currentpage").val(0);
            $("#searchform").submit();
        }
        
 
    	
        function doDeleteTableRow(id){

    	 
    		jConfirm('确定删除该记录?', '提示', function(r) {
    			  if(r==true){
    				$("#searchform").attr("action","${base}/del_return_money?id="+id);
    		    	$("#searchform").submit();
    			  }
    		});
    		 
        }
        
        function changeStatus(status,id){

			jConfirm('确定'+(status==0? '开启':'暂停')+'?', '提示', function(r) { 
				if(r==true){
		        	if(status==1){
		        		status=0;
		        	}else if(status==0){
		        		status=1;
		        	} 
		        	
					$("#searchform").attr("action",'${base}/update_status_return_money?status='+status+'&id='+id);
					$("#searchform").submit();
				}
			});
        }
        
   	 
    	//弹出修改界面
        function showEditDiv(id){
      	
        	showDialog("${base}/view_return_money?task=edit&id="+id,"1400","1000");
    	}
          

        function addEntity()
        {
        	showDialog("${base}/view_return_money?task=add","1400","1000");
        }
        
        function showReceiveList(returnmoneyid){
        	showDialog("${base}/return_money_receive_list?retuernMoneyid="+returnmoneyid,"850","450");
        }
 
        
    </script>
  
</head>

<body>
 
<div class="page-container row-fluid">

<#include "bases/sidebar.ftl">
<#include "bases/navhead.ftl">

    <div class="page-content secMenu-content" id="loading">
     
        <div class="container-fluid">
 
            <div class="row-fluid">
                <div class="span12">
                    <div class="portlet box green">
                        <div class="portlet-title">
                            <div class="caption"><i class="fa fa-cogs"></i>返现活动列表</div>
                            <div class="tools">
                                <a href="javascript:window.location.reload()" class="reload"></a>
                            </div>
                        </div>
                        <div class="portlet-body flip-scroll">
                            <form id="searchform" action="${base}/return_money_manage" method="POST">
                               
                                <div class="controls controls-row">
                                    <input  name="name" type="text" class="form-control sheet-searchInput" id="name" value="<#if name??>${name}</#if>" placeholder="活动名称"/>
                                   
                                    <button type="submit" class="btn blue" onclick="searchButton()">搜索 </button>
                                
                                    <input  type="hidden" id="currentpage" name="page" value="0" />
                                    <input  type="hidden" id="postsortfield" name="sortfield" value="<#if sortfield??>${sortfield}</#if>" />
                             
                                </div>
                                <div class="controls controls-row" style="margin-top: 20px">
                                    <button id="sample_editable_1_new" type="button" class="btn green" onclick="addEntity()"><i class="fa fa-plus"></i>增加返现活动</button>
 
                                </div>
                                <table  class="table table-bordered table-hover table-striped table-condensed list-table">
                                    <thead class="flip-content">
                                    <tr>
                                          <th>编号</th>
								          <th style="text-align: center;">返现名称</th>
								          <th style="text-align: center;">面额</th>
								          <th style="text-align: center;">开始时间</th>
								          <th style="text-align: center;">结束时间</th>
								          <th style="text-align: center;">状态</th>
								          <th style="text-align: center;" onclick="javascript:doTableSort('opername')">操作员</th>
								          <th style="text-align: center;">最后操作时间</th>
								          <th style="text-align: center;width: 200px">操作</th>
								  
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <#list retur_mnoney_list as item>
                                    <tr>
                                        <td style="text-align: center;"><#if item_index??>${item_index+1}</#if></td>
                                        <td style="text-align: center;"><#if item.getName()??>${item.getName()}</#if></td>
                                        <td style="text-align: center;"><#if item.getAmount()??>${item.getAmount()/100}元</#if></td>
                                        <td style="text-align: center;"><#if item.getBegintime()??>${item.getBegintime()}</#if></td>
                                        <td style="text-align: center;"><#if item.getEndtime()??>${item.getEndtime()}</#if></td>
                                        <td style="text-align: center;"><#if item.getStatusName()??>${item.getStatusName()}</#if></td>
                                        <td style="text-align: center;"><#if item.getOpername()??>${item.getOpername()}</#if></td>
                                        <td style="text-align: center;"><#if item.getOperdate()??>${item.getOperdate()}</#if></td>
                                        <td style="text-align: center;">
                                         
                                            <a  onclick="showReceiveList('${item.getId()}');">发放记录</a>
                                         	<a  onclick="changeStatus('${item.getStatus()}','${item.getId()}');"><#if item.getStatus()==1>暂停<#else>开启</#if></a>
                                            
                                            <a onclick="showEditDiv('<#if item.getId()??>${item.getId()}</#if>');">查看修改</a>
                                      
                                      	    <a  onclick="javascript:doDeleteTableRow('${item.getId()}')" class="bianji">删除</a>
                                        </td>
                                    </tr>
                                    </#list>
                                    </tbody>
                                </table>
                                <div class="controls controls-row">
                                    <div id="Pagination" class="pagination"></div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
  </div>
 
</body>
</html>

 
